<?php

class authenticationSubApp extends application {

    public $defaultPage = 'login';

    public function init(){

        # Add some pages
        $this->addPage('login','pageLogin();');
        $this->addPage('loginiframe','pageLoginIframe();');
        $this->addPage('register','pageRegister();');
        $this->addPage('registersucces','pageRegisterSucces();');

        parent::init();

    }

    public function pageLogin() {

        $page = $this->createMainPage('Login', 'defaultpage');

        return $page;

    }

    public function pageLoginIframe() {

        $page = $this->createMainPage('Login', 'authenticationloginiframe');

        $this->loadForm('loginform',$page,'loginform');

        return $page;

    }

    public function pageRegister() {

       $page = $this->createMainPage('Register', 'subpage');

       $page->append('<h1>Registreren</h1><br/>Vul uw informatie persoonlijke informatie in om een account aan te maken.<br/><br/>','content');
       $this->loadForm('registerform', $page, 'content');

       return $page;

    }

    public function pageRegisterSucces() {

       $page = $this->createMainPage('Register', 'subpage');

       $page->append('<h1>Registreren succesvol</h1><br/><br/>','content');
       $page->append('u heeft succesvol een account geregistreerd. U kunt nu verder gaan met inloggen.', 'content');

       return $page;

    }

}

?>
